home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / necko / nsIProgressEventSink.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  7KB  |  164 lines

  1. /*
  2.  * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsIProgressEventSink.idl
  3.  */
  4.  
  5. #ifndef __gen_nsIProgressEventSink_h__
  6. #define __gen_nsIProgressEventSink_h__
  7.  
  8.  
  9. #ifndef __gen_nsISupports_h__
  10. #include "nsISupports.h"
  11. #endif
  12.  
  13. /* For IDL files that don't want to include root IDL files. */
  14. #ifndef NS_NO_VTABLE
  15. #define NS_NO_VTABLE
  16. #endif
  17. class nsIURI; /* forward declaration */
  18.  
  19. class nsIRequest; /* forward declaration */
  20.  
  21.  
  22. /* starting interface:    nsIProgressEventSink */
  23. #define NS_IPROGRESSEVENTSINK_IID_STR "d974c99e-4148-4df9-8d98-de834a2f6462"
  24.  
  25. #define NS_IPROGRESSEVENTSINK_IID \
  26.   {0xd974c99e, 0x4148, 0x4df9, \
  27.     { 0x8d, 0x98, 0xde, 0x83, 0x4a, 0x2f, 0x64, 0x62 }}
  28.  
  29. /**
  30.  * nsIProgressEventSink
  31.  *
  32.  * This interface is used to asynchronously convey channel status and progress
  33.  * information that is generally not critical to the processing of the channel.
  34.  * The information is intended to be displayed to the user in some meaningful
  35.  * way.
  36.  *
  37.  * An implementation of this interface can be passed to a channel via the
  38.  * channel's notificationCallbacks attribute.  See nsIChannel for more info.
  39.  *
  40.  * The channel will begin passing notifications to the progress event sink
  41.  * after its asyncOpen method has been called.  Notifications will cease once
  42.  * the channel calls its listener's onStopRequest method or once the channel
  43.  * is canceled (via nsIRequest::cancel).
  44.  *
  45.  * NOTE: This interface is actually not specific to channels and may be used
  46.  * with other implementations of nsIRequest.
  47.  *
  48.  * @status UNDER_REVIEW
  49.  */
  50. class NS_NO_VTABLE nsIProgressEventSink : public nsISupports {
  51.  public: 
  52.  
  53.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_IPROGRESSEVENTSINK_IID)
  54.  
  55.   /**
  56.      * Called to notify the event sink that progress has occurred for the
  57.      * given request.
  58.      *
  59.      * @param aRequest
  60.      *        the request being observed (may QI to nsIChannel).
  61.      * @param aContext
  62.      *        if aRequest is a channel, then this parameter is the listener
  63.      *        context passed to nsIChannel::asyncOpen.
  64.      * @param aProgress
  65.      *        numeric value in the range 0 to aProgressMax indicating the
  66.      *        number of bytes transfered thus far.
  67.      * @param aProgressMax
  68.      *        numeric value indicating maximum number of bytes that will be
  69.      *        transfered (or 0xFFFFFFFFFFFFFFFF if total is unknown).
  70.      */
  71.   /* void onProgress (in nsIRequest aRequest, in nsISupports aContext, in unsigned long long aProgress, in unsigned long long aProgressMax); */
  72.   NS_IMETHOD OnProgress(nsIRequest *aRequest, nsISupports *aContext, PRUint64 aProgress, PRUint64 aProgressMax) = 0;
  73.  
  74.   /**
  75.      * Called to notify the event sink with a status message for the given
  76.      * request.
  77.      *
  78.      * @param aRequest
  79.      *        the request being observed (may QI to nsIChannel).
  80.      * @param aContext
  81.      *        if aRequest is a channel, then this parameter is the listener
  82.      *        context passed to nsIChannel::asyncOpen.
  83.      * @param aStatus
  84.      *        status code (not necessarily an error code) indicating the
  85.      *        state of the channel (usually the state of the underlying
  86.      *        transport).  see nsISocketTransport for socket specific status
  87.      *        codes.
  88.      * @param aStatusArg
  89.      *        status code argument to be used with the string bundle service
  90.      *        to convert the status message into localized, human readable
  91.      *        text.  the meaning of this parameter is specific to the value
  92.      *        of the status code.  for socket status codes, this parameter
  93.      *        indicates the host:port associated with the status code.
  94.      */
  95.   /* void onStatus (in nsIRequest aRequest, in nsISupports aContext, in nsresult aStatus, in wstring aStatusArg); */
  96.   NS_IMETHOD OnStatus(nsIRequest *aRequest, nsISupports *aContext, nsresult aStatus, const PRUnichar *aStatusArg) = 0;
  97.  
  98. };
  99.  
  100. /* Use this macro when declaring classes that implement this interface. */
  101. #define NS_DECL_NSIPROGRESSEVENTSINK \
  102.   NS_IMETHOD OnProgress(nsIRequest *aRequest, nsISupports *aContext, PRUint64 aProgress, PRUint64 aProgressMax); \
  103.   NS_IMETHOD OnStatus(nsIRequest *aRequest, nsISupports *aContext, nsresult aStatus, const PRUnichar *aStatusArg); 
  104.  
  105. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  106. #define NS_FORWARD_NSIPROGRESSEVENTSINK(_to) \
  107.   NS_IMETHOD OnProgress(nsIRequest *aRequest, nsISupports *aContext, PRUint64 aProgress, PRUint64 aProgressMax) { return _to OnProgress(aRequest, aContext, aProgress, aProgressMax); } \
  108.   NS_IMETHOD OnStatus(nsIRequest *aRequest, nsISupports *aContext, nsresult aStatus, const PRUnichar *aStatusArg) { return _to OnStatus(aRequest, aContext, aStatus, aStatusArg); } 
  109.  
  110. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  111. #define NS_FORWARD_SAFE_NSIPROGRESSEVENTSINK(_to) \
  112.   NS_IMETHOD OnProgress(nsIRequest *aRequest, nsISupports *aContext, PRUint64 aProgress, PRUint64 aProgressMax) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnProgress(aRequest, aContext, aProgress, aProgressMax); } \
  113.   NS_IMETHOD OnStatus(nsIRequest *aRequest, nsISupports *aContext, nsresult aStatus, const PRUnichar *aStatusArg) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnStatus(aRequest, aContext, aStatus, aStatusArg); } 
  114.  
  115. #if 0
  116. /* Use the code below as a template for the implementation class for this interface. */
  117.  
  118. /* Header file */
  119. class nsProgressEventSink : public nsIProgressEventSink
  120. {
  121. public:
  122.   NS_DECL_ISUPPORTS
  123.   NS_DECL_NSIPROGRESSEVENTSINK
  124.  
  125.   nsProgressEventSink();
  126.  
  127. private:
  128.   ~nsProgressEventSink();
  129.  
  130. protected:
  131.   /* additional members */
  132. };
  133.  
  134. /* Implementation file */
  135. NS_IMPL_ISUPPORTS1(nsProgressEventSink, nsIProgressEventSink)
  136.  
  137. nsProgressEventSink::nsProgressEventSink()
  138. {
  139.   /* member initializers and constructor code */
  140. }
  141.  
  142. nsProgressEventSink::~nsProgressEventSink()
  143. {
  144.   /* destructor code */
  145. }
  146.  
  147. /* void onProgress (in nsIRequest aRequest, in nsISupports aContext, in unsigned long long aProgress, in unsigned long long aProgressMax); */
  148. NS_IMETHODIMP nsProgressEventSink::OnProgress(nsIRequest *aRequest, nsISupports *aContext, PRUint64 aProgress, PRUint64 aProgressMax)
  149. {
  150.     return NS_ERROR_NOT_IMPLEMENTED;
  151. }
  152.  
  153. /* void onStatus (in nsIRequest aRequest, in nsISupports aContext, in nsresult aStatus, in wstring aStatusArg); */
  154. NS_IMETHODIMP nsProgressEventSink::OnStatus(nsIRequest *aRequest, nsISupports *aContext, nsresult aStatus, const PRUnichar *aStatusArg)
  155. {
  156.     return NS_ERROR_NOT_IMPLEMENTED;
  157. }
  158.  
  159. /* End of implementation class template. */
  160. #endif
  161.  
  162.  
  163. #endif /* __gen_nsIProgressEventSink_h__ */
  164.